
package vv.lines.core.animations;

import java.util.Collection;
import java.util.List;
import vv.lines.core.Ball;
import vv.lines.core.Cell;

/**
 * @author vpotapenko
 */
public abstract class AbstractAnimation implements Animation {

    private Collection<Ball> target;
    private int priority;
    private List<Cell> cells;

    public void setTarget(Collection<Ball> balls) {
        this.target = balls;
    }

    public Collection<Ball> getTarget() {
        return target;
    }

    public int getPriority() {
        return priority;
    }

    public void setPriority(int priority) {
        this.priority = priority;
    }

    protected List<Cell> getCells() {
        return cells;
    }

    public void setCells(List<Cell> cells) {
        this.cells = cells;
    }

    public void updateKey() {
        updateAnimationState();

        if (hasAnimation()) updateView();
    }

    protected abstract void updateView();

    protected abstract void updateAnimationState();

}
